<?php 
$cid        = gpc_getStringArray('cid');
$name       = "";

if(count($cid)==0)
{
    $cid[0]=$id;
}

foreach($cid as $id)
{
    //---------------Lay thong tin ve product sap xoa
    $sql_select = "SELECT cName,iParentId FROM tblproduct WHERE iId = $id";
    $rs=$dbsql->query($sql_select);
    if($result = $dbsql->fetch_array($rs))
    {
        $ContentName    = $result["cName"];
    	$category       = $result['iParentId'];
    }
    //--------------Xoa product da duoc chi dinh
    $sql_delete = "DELETE FROM tblproduct WHERE iId = $id";
    $dbsql->query($sql_delete);
    
    //------------------------------Tracking
    Insert_Tracking("Del product : $ContentName ");
}

$msg = "Delete Product '$ContentName' success !";
page_transfer($msg,$pagetr);
exit();
?>